package builder;

import java.util.Vector;

import model.Action;

public class BridgeBuilder extends AbstractPatternBuilder {
	
	private String client = "Client";
	private String abstraction = "Abstraction";
	private String refinedAbstraction = "RefinedAbstraction";
	private String implementor = "Implementor";
	private String concreteImplementorA = "ConcreteImplementorA";
	private String concreteImplementorB = "ConcreteImplementorB";
	
	public BridgeBuilder() {
		super();
	}

	@Override
	public Vector<Action> buildPattern() {
		
		this.buildClass(client);
		this.buildClass(refinedAbstraction);
		this.buildClass(concreteImplementorA);
		this.buildClass(concreteImplementorB);
		
		this.buildAbstractClass(abstraction);
		this.buildAbstractClass(implementor);
		
		this.buildGeneralization(refinedAbstraction, abstraction);
		this.buildGeneralization(concreteImplementorA, implementor);
		this.buildGeneralization(concreteImplementorB, implementor);
		
		this.buildAggregation(implementor,abstraction);
		
		this.buildAssociation(client, abstraction);
		
		return patternActions;
	}

	@Override
	public void changeNames() {

		this.client = names.get(0);
		this.abstraction = names.get(1);
		this.refinedAbstraction = names.get(2);
		this.implementor = names.get(3);
		this.concreteImplementorA = names.get(4);
		this.concreteImplementorB = names.get(5);
		
	}
	
	@Override
	public int cantUMLElements() {
		return 6;
	}

}
